home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / checkbox / registries / sysctl.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.3 KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import logging
  5. import posixpath
  6. from checkbox.lib.path import path_expand
  7. from checkbox.properties import Path
  8. from checkbox.registry import Registry
  9. from checkbox.registries.directory import RecursiveDirectoryRegistry
  10. from checkbox.registries.filename import FilenameRegistry
  11.  
  12. class SysctlRegistry(Registry):
  13.     '''Registry for files contained in /etc/modprobe.d.'''
  14.     path = Path(default = '/etc/sysctl.*')
  15.     
  16.     def items(self):
  17.         items = []
  18.         paths = path_expand(self.path)
  19.         for path in paths:
  20.             key = posixpath.basename(path)
  21.             if posixpath.isfile(path):
  22.                 value = FilenameRegistry(path)
  23.             elif posixpath.isdir(path):
  24.                 value = RecursiveDirectoryRegistry(path)
  25.             else:
  26.                 logging.info('Unknown sysctl path: %s', path)
  27.             items.append((key, value))
  28.         
  29.         return items
  30.  
  31.  
  32. factory = SysctlRegistry
  33.